/*
 * @Author: monster.huangwei 
 * @Date: 2018-11-04 16:53:51 
 * @Last Modified by: monster.huangwei
 * @Last Modified time: 2018-11-10 15:56:02
 */
import {Tools} from '@/lib/tools'
const util = {
    /**
     * 设置页面标题
     * @param title 标题名称
     */
    setTitle: (title) => {
        console.log('title', title)
        if (Tools.check.isEmpty(title)) {
          title = "店铺信息";
        }
        window.document.title=title;
    },
    getInputLength(value){
        let cnReg = /([\u4e00-\u9fa5]|[\u3000-\u303F]|[\uFF00-\uFF60])/g;
        let mat = value.match(cnReg);
        if (mat) {
            return  mat.length*2 + (value.length - mat.length)
        }
        return value.length
    },
}

export default util